package com.istock.union.controller;

import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.istock.base.common.api.model.ApiBaseResponse;
import com.istock.base.common.api.model.RetStatusEnum;
import com.istock.union.user.model.SecurityChecker;

@Controller
@RequestMapping("/s/test")
public class TestController {

	@RequestMapping("test1")
	@SecurityChecker("senvon.test1")
	public void test1(HttpServletResponse response) throws Exception {
		response.setContentType("application/json");
		response.getWriter().println("return success");
        response.getWriter().flush();
	}
	
	@RequestMapping("test2")
	@SecurityChecker("senvon.test2")
	public String test2(HttpServletResponse response) throws Exception {
		return "success";
	}
	
	@RequestMapping("test3")
	@SecurityChecker("senvon.test3")
	public ApiBaseResponse<Boolean> test3(HttpServletResponse response) throws Exception {
		return new ApiBaseResponse<Boolean>(RetStatusEnum.SUCCESS , "S","test message",true);
	}
}
